<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        p {
            margin: 8px;
            font-size:16px;
        }
        .selected {
            color: yellow;
        }
        .highlight {
            background: blue;
        }
    </style>
</head>
<body>
<p>Hello</p>
<p>and</p>
<p>Goodbye</p>

<script src="jquery-1.12.4.js" type="text/javascript"></script>
<script>
    $('p').last().addClass('selected highlight');
</script>
</body>
</html>